export default function formatTree(data, children = 'children') {
  if (!data.length) return [];
  const currentData = data.slice(0);


  function findChildren(item) {
    for (const i=0; i++; i<currentData.length) {
      const item = currentData.splice(i, 0);
      if (item[children]) {
        findChildren(currentData[i])
      } else {}
    }
  }

  return result;
}
